package edu.bbu.commonproject.backend.db.factory;

import edu.bbu.commonproject.backend.db.factory.mongodb.MongoDBDAOFactory;
import edu.bbu.commonproject.backend.db.services.DirectoryDAOServices;
import edu.bbu.commonproject.backend.db.services.FileDAOServices;
import edu.bbu.commonproject.backend.db.services.UserDAOServices;

/**
 * Abstract DAO factory class.
 */
public abstract class DAOFactory
{
	/** The supported database types. */
	public static final int MONGODB_FACTORY = 1;
	
	/**
	 * Getting the user services.
	 * @return the selected user DAO service.
	 */
	public abstract UserDAOServices getUserDAOServices();
	
	/**
	 * Getting the file services.
	 * @return the selected file DAO service.
	 */
	public abstract FileDAOServices getFileDAOServices();
	
	/**
	 * Getting the directory services.
	 * @return the selected directory DAO service.
	 */
	public abstract DirectoryDAOServices getDirectoryServices();
	
	/**
	 * Getting a specified factory type.
	 * @param factoryType the factory type.
	 * @return a new factory, with the choosed type, or null if the factory type does not exist. 
	 */
	public static final DAOFactory getDAOFactory(int factoryType)
	{
		switch (factoryType)
		{
			case MONGODB_FACTORY:
			{
				return new MongoDBDAOFactory();
			}
		}
		
		return null;
	}
}
